<?php
namespace Home\Model;
use Think\Model;

/**
* 
*/
class CourtesyModel extends Model
{
	protected $tableName = 'card_list';

	function get_cardlist($type_id = 1)
	{

        $field = array(
                'type_id' => $type_id
                );
        //$result = $this->field('*')->table($tableName)->where($field)->order('card_id asc')->fetchSql(true)->select();
        $result = $this->field('card_id,card_name,card_img,card_integral,start_time,end_time')->table($tableName)->where($field)->order('card_id asc')->select();

        return $result;
	}

    function get_cardinfo($card_id)
    {
        $field = array(
                'card_id' => $card_id
                );
        //$result = $this->field('*')->table($tableName)->where($field)->order('card_id asc')->fetchSql(true)->select();
        $result = $this->table($tableName)->where($field)->order('card_id asc')->find();
        
        return $result;
    }

}